/**
 * 
 */
package santeclair.referentiel.webservice.rest.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import santeclair.referentiel.dto.TypeContratDto;
import santeclair.referentiel.gestionnaire.bean.TypeContrat;
import santeclair.referentiel.gestionnaire.service.TypeContratService;
import santeclair.referentiel.webservice.TypeContratWebService;

/**
 * @author cquintin
 * 
 */
@Service("typeContratWebService")
public class TypeContratWebServiceImpl implements TypeContratWebService {

    @Autowired
    private TypeContratService typeContratService;

    /**
     * {@inheritDoc}
     */
    @Override
    public TypeContratDto findTypeContratByCode(String code) {
        TypeContratDto dto = new TypeContratDto();
        TypeContrat typeContrat = typeContratService.findTypeContratByCode(code);
        dto.setCode(typeContrat.getCode());
        dto.setId(typeContrat.getId());
        dto.setLibelle(typeContrat.getLibelle());
        return dto;
    }

}
